<div class="shoot-rectify">
  <div class="rectify-body">
    <form [formGroup]="addRectify">
      <div class="ui-g ui-fluid ui-md">
        <div class="ui-g-12 ui-md-12" style="line-height: 4vh">
          <div class="ui-g-1 ui-md-1 right">
            <label><span style="color: #FF8A9A">*</span>隐患发生单位:</label>
          </div>
          <div class="ui-g-4 ui-md-4 dialog-input">
            <input pInputText type="text" placeholder="请选择隐患发生单位" (click)="showTreeDialog(1)" formControlName="organizationName"/>
          </div>
          <div class="ui-g-1 ui-md-1"></div>
          <div class="ui-g-1 ui-md-1 right">
            <label><span style="color: #FF8A9A">*</span>排查时间:</label>
          </div>
          <div class="ui-g-4 ui-md-4 dialog-input">
            <p-calendar [style]="{width: '100%'}" placeholder="请选择排查时间" [monthNavigator]="true" [yearNavigator]="true"
                        dateFormat="yy-mm-dd" yearRange="1949:2200" [locale]="esDate" formControlName="troubleshootingTime"></p-calendar>
          </div>
        </div>
        <div class="ui-md-12 ui-g-12"  style="line-height: 4vh">
          <div class="ui-g-1 ui-md-1 right">
            <label><span style="color: #FF8A9A">*</span>隐患类型:</label>
          </div>
          <div class="ui-g-4 ui-md-4 dialog-input left">
            <div class="ui-g-2 ui-g-md-2">
              <p-checkbox name="groupname2" value="人"  label="人" [formControl]="addRectify.controls['hidType']" ></p-checkbox>
            </div>
            <div class="ui-g-2 ui-g-md-2">
              <p-checkbox name="groupname2" value="事物"  label="事物" [formControl]="addRectify.controls['hidType']"></p-checkbox>
            </div>
            <div class="ui-g-2 ui-g-md-2">
              <p-checkbox name="groupname2" value="管理"  label="管理" [formControl]="addRectify.controls['hidType']"></p-checkbox>
            </div>
          </div>
          <div class="ui-g-1 ui-md-1"></div>
          <div class="ui-g-1 ui-md-1 right">
            <label><span style="color: #FF8A9A">*</span>隐患等级:</label>
          </div>
          <div class="ui-g-4 ui-md-4 dialog-input left">
            <p-dropdown dropdownIcon="pi pi-caret-down" placeholder="请选择隐患等级" [options]="hidFradeOption" formControlName="hidDangerGrade"></p-dropdown>
          </div>
        </div>
        <div class="ui-md-12 ui-g-12">
          <div class="ui-g-1 ui-md-1 right">
            <label ><span style="color: #FF8A9A">*</span>隐患内容:</label>
          </div>
          <div class="ui-g-10 ui-md-10">
            <textarea [rows]="5" [cols]="30" pInputTextarea autoResize="autoResize" style="border: 1px solid #D2D6DB" formControlName="hidDangerContent"></textarea>
          </div>
        </div>
        <div class="ui-g-12 ui-md-12"  style="line-height: 4vh">
          <div class="ui-g-1 ui-md-1 right">
            <label><span style="color: #FF8A9A">*</span>整改单位:</label>
          </div>
          <div class="ui-g-4 ui-md-4 dialog-input">
            <input pInputText type="text" placeholder="请选择整改单位" (click)="showTreeDialog(2)" formControlName="rectificationUnitName"/>
          </div>
          <div class="ui-g-1 ui-md-1"></div>
          <div class="ui-g-1 ui-md-1 right">
            <label><span style="color: #FF8A9A">*</span>整改截止时间:</label>
          </div>
          <div class="ui-g-4 ui-md-4 dialog-input">
            <p-calendar [style]="{width: '100%'}" placeholder="请选择整改截止时间" [monthNavigator]="true" [yearNavigator]="true"
                        dateFormat="yy-mm-dd" yearRange="1949:2200" [locale]="esDate" formControlName="specifiedRectificationTime"></p-calendar>
          </div>
        </div>
        <div class="ui-md-12 ui-g-12">
          <div class="ui-g-1 ui-md-1 right">
            <label ><span style="color: #FF8A9A">*</span>整改意见:</label>
          </div>
          <div class="ui-g-10 ui-md-10">
            <textarea [rows]="5" [cols]="30" pInputTextarea autoResize="autoResize" style="border: 1px solid #D2D6DB" formControlName="rectificationOpinions"></textarea>
          </div>
        </div>
        <div class="ui-md-12 ui-g-12">
          <div class="ui-g-1 ui-md-1 right">
            <label ><span style="color: #FF8A9A">*</span>隐患现场情况:</label>
          </div>
          <div class="ui-g-10 ui-md-10">
            <app-upload-image (selectFile)="selectImageFile($event)" #upimg [ImageOption]="this.ImageOption"></app-upload-image>
          </div>
        </div>
        <div class="ui-md-12 ui-g-12" style="line-height: 3vh">
          <div class="ui-g-1 ui-md-1 right">
            <label ><span style="color: #FF8A9A">*</span>通知书附件:</label>
          </div>
          <div class="ui-g-4 ui-md-4 dialog-input">
            <div class="ui-inputgroup" style="position: relative">
              <input type="text" pInputText placeholder="请选择通知书附件" formControlName="notice">
              <button pButton type="button" icon="pi pi-folder" class="ui-button-warn" style="background: #F8F8F8;border: 1px solid #E0E3E7;border-left: 0;color: #E0E3E7"></button>
              <input type="file" style="position: absolute;width: 35px;right: 0;height: 34px;opacity: 0" (change)="selectFile($event)">
            </div>
          </div>
        </div>
      </div>
    </form>
  </div>
  <div class="rectify-fotter">
    <button pButton type="button" label="下发整改" class="ui-button-rounded" (click)="submitClick()"></button>
<!--    <button pButton type="button" label="批量下发整改" class="ui-button-rounded"></button>-->
  </div>
  <!--组织树结构-->
  <p-dialog [(visible)]="treeDialog" [responsive]="true" showEffect="fade" [modal]= false [maximizable]="false" [baseZIndex]="10000" [width]="350" [height]="400">
    <div class="ui-g ui-fluid">
      <div class="ui-g-12">
        <p-scrollPanel [style]="{width: '100%', height: '250px'}">
          <p-tree
            [value]="OrgTrees"
            [(selection)]="OrgTree"
            selectionMode="single">
          </p-tree>
        </p-scrollPanel>
      </div>
    </div>
    <p-footer>
      <button  style="width: 4vw;padding: 4px 0"  (click)="treeDialog = false">取消</button>
      <button  style="width: 6vw;border: 0;color: #fff;padding: 4px 0"   (click)="dataTreeSureClick()" >确认选择</button>
    </p-footer>
  </p-dialog>
</div>
